/*
 * MainView.java
 */
package przychodnia;

import DTO.Pacjenci;
import hibernate.PrzychodniaHibernateUtil;
import javax.swing.event.ListSelectionEvent;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

/**
 * The application's main frame.
 */
public class MainView extends FrameView
{

    private Session ses = PrzychodniaHibernateUtil.getSessionFactory().openSession();
    private List pat;    // wyswietlani pacjenci w tablicy

    public MainView(SingleFrameApplication app)
    {
        super(app);

        java.util.logging.Logger logger = java.util.logging.Logger.getLogger(org.jdesktop.application.SessionStorage.class.getName());
        logger.setLevel(java.util.logging.Level.OFF);

        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener()
        {

            public void actionPerformed(ActionEvent e)
            {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++)
        {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener()
        {

            public void actionPerformed(ActionEvent e)
            {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener()
        {

            public void propertyChange(java.beans.PropertyChangeEvent evt)
            {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName))
                {
                    if (!busyIconTimer.isRunning())
                    {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName))
                {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName))
                {
                    String text = (String) (evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName))
                {
                    int value = (Integer) (evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });

        pat = ses.createQuery("from Pacjenci").list();


        /*Timer timer = new Timer(100, new ActionListener()
        {
        
        public void actionPerformed(ActionEvent evt)
        {
        refreshTable();
        }
        });
        
        timer.start();*/
        refreshTable();

        filterTextField.addActionListener(new ActionListener()
        {

            public void actionPerformed(ActionEvent e)
            {
                // jesli wybrano nazwisko
                if (buttonGroup1.getSelection() == surnameRadioButton.getModel())
                {
                    pat = ses.createCriteria(Pacjenci.class).
                            add(Restrictions.like("nazwisko", "%" + filterTextField.getText() + "%")).list();
                } // jesli wybrano imie
                else if (buttonGroup1.getSelection() == nameRadioButton.getModel())
                {
                    pat = ses.createCriteria(Pacjenci.class).
                            add(Restrictions.like("imie", "%" + filterTextField.getText() + "%")).list();
                } // jesli wybrano PESEL
                else if (buttonGroup1.getSelection() == peselRadioButton.getModel())
                {
                    pat = ses.createCriteria(Pacjenci.class).
                            add(Restrictions.like("PESEL", "%" + filterTextField.getText() + "%")).list();
                }
                refreshTable();
            }
        });


        patientsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener()
        {

            public void valueChanged(ListSelectionEvent lse)
            {
                if (patientsTable.getSelectedRow() < 0)
                {
                    patientEditButton.setEnabled(false);
                    visitAddButton.setEnabled(false);
                } else
                {
                    patientEditButton.setEnabled(true);
                    visitAddButton.setEnabled(true);
                }
            }
        });
    }

    private void refreshTable()
    {
        //System.out.println("update");
        //ses = PrzychodniaHibernateUtil.getSessionFactory().openSession();

        //List results = ses.createCriteria(Pracownicy.class).list();
        //pat = ses.createQuery("from Pacjenci").list();

        DefaultTableModel model = (DefaultTableModel) patientsTable.getModel();
        model.setNumRows(0);
        model.setRowCount(pat.size());

        for (int i = 0; i < pat.size(); ++i)
        {
            Pacjenci pac = (Pacjenci) pat.get(i);
            model.setValueAt(pac.getID(), i, 0);
            model.setValueAt(pac.getNazwisko(), i, 1);
            model.setValueAt(pac.getImie(), i, 2);
            model.setValueAt(pac.getPESEL(), i, 3);
            model.setValueAt(pac.getUlica() + ", " + pac.getPoczta(), i, 4);
            model.setValueAt(pac.getTelefon(), i, 5);
        }
    }


    @Action
    public void showAboutBox()
    {
        if (aboutBox == null)
        {
            JFrame mainFrame = Main.getApplication().getMainFrame();
            aboutBox = new MainAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        Main.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        patientsTable = new javax.swing.JTable();
        patientAddButton = new javax.swing.JButton();
        patientEditButton = new javax.swing.JButton();
        visitAddButton = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        filterTextField = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        surnameRadioButton = new javax.swing.JRadioButton();
        nameRadioButton = new javax.swing.JRadioButton();
        peselRadioButton = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        buttonGroup1 = new javax.swing.ButtonGroup();

        mainPanel.setName("mainPanel"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        patientsTable.setAutoCreateRowSorter(true);
        patientsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID", "Nazwisko", "Imię", "PESEL", "Adres zamieszkania", "Numer telefonu"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Long.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        patientsTable.setName("patientsTable"); // NOI18N
        jScrollPane1.setViewportView(patientsTable);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(przychodnia.Main.class).getContext().getResourceMap(MainView.class);
        patientsTable.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title5")); // NOI18N
        patientsTable.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title0")); // NOI18N
        patientsTable.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title1")); // NOI18N
        patientsTable.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title2")); // NOI18N
        patientsTable.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title3")); // NOI18N
        patientsTable.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("patientsTable.columnModel.title4")); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(przychodnia.Main.class).getContext().getActionMap(MainView.class, this);
        patientAddButton.setAction(actionMap.get("addPatient")); // NOI18N
        patientAddButton.setText(resourceMap.getString("patientAddButton.text")); // NOI18N
        patientAddButton.setName("patientAddButton"); // NOI18N

        patientEditButton.setAction(actionMap.get("EdycjaPacjenta")); // NOI18N
        patientEditButton.setText(resourceMap.getString("patientEditButton.text")); // NOI18N
        patientEditButton.setEnabled(false);
        patientEditButton.setName("patientEditButton"); // NOI18N
        patientEditButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                patientEditButtonActionPerformed(evt);
            }
        });

        visitAddButton.setAction(actionMap.get("EdycjaWizyty")); // NOI18N
        visitAddButton.setText(resourceMap.getString("visitAddButton.text")); // NOI18N
        visitAddButton.setEnabled(false);
        visitAddButton.setName("visitAddButton"); // NOI18N
        visitAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                visitAddButtonActionPerformed(evt);
            }
        });

        jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
        jButton5.setName("jButton5"); // NOI18N
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        filterTextField.setText(resourceMap.getString("filterTextField.text")); // NOI18N
        filterTextField.setName("filterTextField"); // NOI18N

        jButton8.setText(resourceMap.getString("jButton8.text")); // NOI18N
        jButton8.setName("jButton8"); // NOI18N
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        buttonGroup1.add(surnameRadioButton);
        surnameRadioButton.setSelected(true);
        surnameRadioButton.setText(resourceMap.getString("surnameRadioButton.text")); // NOI18N
        surnameRadioButton.setName("surnameRadioButton"); // NOI18N

        buttonGroup1.add(nameRadioButton);
        nameRadioButton.setText(resourceMap.getString("nameRadioButton.text")); // NOI18N
        nameRadioButton.setName("nameRadioButton"); // NOI18N

        buttonGroup1.add(peselRadioButton);
        peselRadioButton.setText(resourceMap.getString("peselRadioButton.text")); // NOI18N
        peselRadioButton.setName("peselRadioButton"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(filterTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                            .addComponent(visitAddButton, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                            .addComponent(patientEditButton, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                            .addComponent(patientAddButton, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addComponent(surnameRadioButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(nameRadioButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(peselRadioButton)
                                .addGap(109, 109, 109))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(87, 87, 87)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE)
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addComponent(patientAddButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(patientEditButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(visitAddButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton5)
                        .addGap(44, 44, 44)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(filterTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(surnameRadioButton)
                            .addComponent(nameRadioButton)
                            .addComponent(peselRadioButton))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton8))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(60, Short.MAX_VALUE))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setText(resourceMap.getString("aboutMenuItem.text")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1024, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 840, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void visitAddButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_visitAddButtonActionPerformed
    {//GEN-HEADEREND:event_visitAddButtonActionPerformed
        EkranEdycjiWizyt jf = new EkranEdycjiWizyt(ses, (Long) patientsTable.getValueAt(patientsTable.getSelectedRow(), 0), 0);
        JFrame mainFrame = Main.getApplication().getMainFrame();
        jf.setLocationRelativeTo(mainFrame);
        Main.getApplication().show(jf);
    }//GEN-LAST:event_visitAddButtonActionPerformed

    @Action
    public void addPatient()
    {
        Long in = new Long(-1);
        EkranEdycjiPacjenta jf = new EkranEdycjiPacjenta(ses, in);
        JFrame mainFrame = Main.getApplication().getMainFrame();
        jf.setLocationRelativeTo(mainFrame);
        Main.getApplication().show(jf);
    }

    private void patientEditButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_patientEditButtonActionPerformed
    {//GEN-HEADEREND:event_patientEditButtonActionPerformed
        EkranEdycjiPacjenta jf = new EkranEdycjiPacjenta(ses, (Long) patientsTable.getValueAt(patientsTable.getSelectedRow(), 0));
        JFrame mainFrame = Main.getApplication().getMainFrame();
        jf.setLocationRelativeTo(mainFrame);
        Main.getApplication().show(jf);
    }//GEN-LAST:event_patientEditButtonActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton5ActionPerformed
    {//GEN-HEADEREND:event_jButton5ActionPerformed
        EkranWizyt jf = new EkranWizyt(ses);
        JFrame mainFrame = Main.getApplication().getMainFrame();
        jf.setLocationRelativeTo(mainFrame);
        Main.getApplication().show(jf);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton8ActionPerformed
    {//GEN-HEADEREND:event_jButton8ActionPerformed
        pat = ses.createQuery("from Pacjenci").list();
        refreshTable();
    }//GEN-LAST:event_jButton8ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JTextField filterTextField;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JRadioButton nameRadioButton;
    private javax.swing.JButton patientAddButton;
    private javax.swing.JButton patientEditButton;
    private javax.swing.JTable patientsTable;
    private javax.swing.JRadioButton peselRadioButton;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JRadioButton surnameRadioButton;
    private javax.swing.JButton visitAddButton;
    // End of variables declaration//GEN-END:variables
    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;
    private JDialog aboutBox;
}
